Skip to content

fix(page): leave touch emulation alone on resize unless mobile is set - #352

Merged
route merged 1 commit into
mainfrom
fix/blink-settings-hover-on-resize
Oct 29, 2026
Merged

route merged 1 commit into
mainfrom
fix/blink-settings-hover-on-resize

Conversation

@route

@route route commented Oct 29, 2026

Copy link
Copy Markdown
Member

Refs #282, rubycdp/ferrum#664.

Cuprite resizes the page whenever it attaches one and on resize_to, maximize and fullscreen. Ferrum's set_viewport used to send Emulation.setTouchEmulationEnabled(enabled: false) for every desktop viewport, and Chrome answers that by resetting hover and pointer to the detected input devices. That undid overrides passed with --blink-settings (e.g. primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4, the workaround from #282), so on headless Linux @media (hover: hover) stopped matching after a resize.

Ferrum 0.20.1 leaves touch emulation alone when set_viewport gets mobile: nil. This makes Options#mobile default to nil instead of false and requires ferrum ~> 0.20.1. mobile: true and the emulate: devices still turn touch emulation on.

The new feature spec launches Chrome with a coarse pointer through --blink-settings and checks it survives current_window.resize_to; it fails with the old false default.

Options#mobile defaults to nil, so resizing a window no longer turns touch emulation off, which reset hover and pointer
overrides passed with --blink-settings. Requires Ferrum 0.20.1. Refs #282, rubycdp/ferrum#664
@route
route merged commit 7629808 into main Oct 29, 2026
6 checks passed
@route
route deleted the fix/blink-settings-hover-on-resize branch October 29, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant